Skip to content

Instantly share code, notes, and snippets.

@mhogg
mhogg / elementConnectivity.py
Created March 17, 2015 05:42
Getting ABAQUS element connectivities
from abaqus import *
from abaqusConstants import *
from odbAccess import *
odb = session.viewports[session.currentViewportName].displayedObject
instName = 'MALE'
elements = odb.rootAssembly.instances[instName].elements
foutName = 'elementConnectivity.txt'
@probonopd
probonopd / Wayland.md
Last active May 12, 2024 17:42
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

@gitdagray
gitdagray / rps_v3.js
Created October 8, 2020 18:31
Rock_Paper_Scissors_v3
// Rock, Paper, Scissors: Refactored with Functions
const initGame = () => {
const startGame = confirm("Shall we play rock, paper, or scissors?");
startGame ? playGame() : alert("Ok, maybe next time.");
};
// Game flow function
const playGame = () => {
while (true) {
let playerChoice = getPlayerChoice();
@gitdagray
gitdagray / rps_v2.js
Created October 8, 2020 18:29
Rock_Paper_Scissors_v2
// Rock, Paper, Scissors: Refactored with While Loop and an Array
let playGame = confirm("Shall we play rock, paper, or scissors?");
if (playGame) {
//play
while (playGame) {
const playerChoice = prompt("Please enter rock, paper, or scissors.");
if (playerChoice || playerChoice === "") {
const playerOne = playerChoice.trim().toLowerCase();
if (
playerOne === "rock" ||
@gitdagray
gitdagray / rps_v1.js
Last active May 12, 2024 17:39
Rock_Paper_Scissors_v1
// Your First Interactive Game
let playGame = confirm("Shall we play rock, paper, or scissors?");
if (playGame) {
//play
let playerChoice = prompt("Please enter rock, paper, or scissors.");
if (playerChoice) {
let playerOne = playerChoice.trim().toLowerCase();
if (
playerOne === "rock" ||
playerOne === "paper" ||
@gitdagray
gitdagray / js_chapter_22_css.css
Created January 3, 2022 17:09
JS Course Chapter 22 CSS
* {
margin: 0;
padding: 0;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
@emiremen
emiremen / CatchKenny.java
Last active May 12, 2024 17:37
Android Studio Catch Kenny oyunu
public class MainActivity extends AppCompatActivity {
ImageView myImg;
TextView textView, textView2;
int score;
int screenX, screenY;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ngupta23
ngupta23 / online_learning_pycaret_sktime.ipynb
Created October 25, 2021 17:40
online_learning_pycaret_sktime.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gitdagray
gitdagray / js_chapter_22_html.html
Created January 3, 2022 17:11
JS Chapter 22 HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Page</title>
<link rel="stylesheet" href="css/js_chapter_22_css.css" />
<script defer src="js/main.js"></script>
</head>
@gitdagray
gitdagray / index.html
Created November 21, 2021 23:17
HTML and CSS for Javascript DOM Tutorial
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Page</title>
<style>
* {
margin: 0;
padding: 0;